home *** CD-ROM | disk | FTP | other *** search
/ Young Minds / Young Minds Interactive CD-ROM.ISO / mpss / scan.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-07-20  |  6.1 KB  |  224 lines

  1.  
  2. /*******************************************************************************
  3. ********************************************************************************
  4. ********************************************************************************
  5.  
  6. PERMISSION TO COPY THIS SOFTWARE IS HEREBY GIVEN BY THE AUTHOR PROVIDED THAT
  7. THIS LEADING MESSAGE IS INCLUDED IN ALL OF THE RELEVANT SOURCE FILES.
  8.  
  9.         P. SCHMITZ, UNIVERSITY OF KEELE, MAY 1988.
  10.  
  11.  
  12. ********************************************************************************
  13. ********************************************************************************
  14. *******************************************************************************/
  15.  
  16. #include "ships.h"
  17. #include "header.h"
  18.  
  19. scan(cp,o)
  20. register struct player *cp,*o;
  21. {
  22. char string[37];
  23.  
  24. plot1(cp,"                        Scanning Sir.                    ");
  25. plot2(cp,"                                                         ");
  26. if (o->energy<200)
  27. {
  28. plot1(o," Spock : Captain, we are being exposed to an energy beam ");
  29. plot2(o," of unknown constituency. It seems we have been scanned. ");
  30. }
  31. poscurs(cp,20,1);
  32. write(cp->fd, "                                                         ",57); 
  33. poscurs(cp,20,2);
  34. write(cp->fd, "                  ~~~~~~~~~~~~~~~~~~~~~~~~~              ",57); 
  35. poscurs(cp,20,3);
  36. write(cp->fd, "                  Remote Subspace Ship Scan              ",57); 
  37. poscurs(cp,20,4);
  38. write(cp->fd, "                  ~~~~~~~~~~~~~~~~~~~~~~~~~              ",57); 
  39. poscurs(cp,20,5);
  40. write(cp->fd, "                                                         ",57); 
  41. poscurs(cp,20,6);
  42. write(cp->fd, "     Name of Ship : ",20); 
  43. switch (o->id)
  44.     {
  45.     case ROMID :
  46.              write(cp->fd,"Names of Romulan vessels are secret. ",37);
  47.          break;
  48.     case KLINGID :
  49.              write(cp->fd,"Names of Klingon vessels are secret. ",37);
  50.          break;
  51.     default: write(cp->fd,ship[o->shipno].name,37);
  52.          break;
  53.     }
  54. poscurs(cp,20,7);
  55. write(cp->fd, "     Registration : ",20); 
  56. switch (o->id)
  57.     {
  58.     case ROMID :
  59.              write(cp->fd,"Registrations of Romulans are secret.",37);
  60.          break;
  61.     case KLINGID :
  62.              write(cp->fd,"Registrations of Klingons are secret.",37);
  63.          break;
  64.     default: 
  65.          write(cp->fd,ship[o->shipno].registration,37);
  66.          break;
  67.     }
  68. poscurs(cp,20,8);
  69. write(cp->fd, "     Class        : ",20); 
  70. switch (o->id)
  71.     {
  72.     case ROMID :
  73.              write(cp->fd,"Heavy Romulan Battle Cruiser.        ",37);
  74.          break;
  75.     case KLINGID :
  76.              write(cp->fd,"Klingon Battle Destroyer Class A.    ",37);
  77.          break;
  78.     default: 
  79.          write(cp->fd,ship[o->shipno].class,37);
  80.          break;
  81.     }
  82. poscurs(cp,20,9);
  83. write(cp->fd, "     Origin       : ",20); 
  84. switch (o->id)
  85.     {
  86.     case ROMID :
  87.              write(cp->fd,"Romulan Sector.                      ",37);
  88.          break;
  89.     case KLINGID :
  90.              write(cp->fd,"Klingon empire, klingon sector.      ",37);
  91.          break;
  92.     default: 
  93.          write(cp->fd,ship[o->shipno].flag,37);
  94.          break;
  95.     }
  96. poscurs(cp,20,10);
  97. write(cp->fd, "     No. of crew  : ",20); 
  98. switch (o->id)
  99.     {
  100.     case ROMID :
  101.              write(cp->fd,"unknown.                             ",37);
  102.          break;
  103.     case KLINGID :
  104.              write(cp->fd,"unknown.                             ",37);
  105.          break;
  106.     default: 
  107.          write(cp->fd,ship[o->shipno].noofcrew,37);
  108.          break;
  109.     }
  110. poscurs(cp,20,11);
  111. write(cp->fd, "     Prefix Code  : ",20); 
  112. switch (o->id)
  113.     {
  114.     case ROMID :
  115.              write(cp->fd,"unknown.                             ",37);
  116.          break;
  117.     case KLINGID :
  118.              write(cp->fd,"unknown.                             ",37);
  119.          break;
  120.     default: 
  121.          write(cp->fd,ship[o->shipno].prefixcode,37);
  122.          break;
  123.     }
  124. poscurs(cp,20,12);
  125. write(cp->fd, "     Current Pos. : ",20); 
  126. sprintf(string,"%3d %3d                             ",o->xpos,o->ypos);
  127. write(cp->fd,string,37);
  128. poscurs(cp,20,13);
  129. write(cp->fd, "     Current Warp : ",20); 
  130. sprintf(string,"%3d %3d                             ",o->xvel,o->yvel);
  131. write(cp->fd,string,37);
  132. poscurs(cp,20,14);
  133. write(cp->fd, "     Energy       : ",20); 
  134. switch (o->id)
  135.     {
  136.     case ROMID :
  137.              sprintf(string,"unknown.                             ");
  138.          break;
  139.     case KLINGID :
  140.              sprintf(string,"unknown.                             ");
  141.          break;
  142.     default: 
  143.         sprintf(string,"   %4d                             ",o->energy);
  144.          break;
  145.     }
  146. write(cp->fd,string,37);
  147. poscurs(cp,20,15);
  148. write(cp->fd, "     Max. Energy  : ",20); 
  149. switch (o->id)
  150.     {
  151.     case ROMID :
  152.              sprintf(string,"unknown.                             ");
  153.          break;
  154.     case KLINGID :
  155.              sprintf(string,"unknown.                             ");
  156.          break;
  157.     default: 
  158.     sprintf(string,"   %4d                             ",o->maxenergy);
  159.          break;
  160.     }
  161. write(cp->fd,string,37);
  162. poscurs(cp,20,16);
  163. write(cp->fd, "     Phaser shots : ",20); 
  164. switch (o->id)
  165.     {
  166.     case ROMID :
  167.              sprintf(string,"unknown.                             ");
  168.          break;
  169.     case KLINGID :
  170.              sprintf(string,"unknown.                             ");
  171.          break;
  172.     default: 
  173.     sprintf(string,"   %4d                             ",o->phaserbanks);
  174.          break;
  175.     }
  176. write(cp->fd,string,37);
  177. poscurs(cp,20,17);
  178. write(cp->fd, "     Phaser range : ",20); 
  179. switch (o->id)
  180.     {
  181.     case ROMID :
  182.              sprintf(string,"Far enough to get you!!              ");
  183.          break;
  184.     case KLINGID :
  185.              sprintf(string,"Far enough to get you!!              ");
  186.          break;
  187.     default: 
  188.     sprintf(string,"   %4d                             ",o->phaserreach);
  189.          break;
  190.     }
  191. write(cp->fd,string,37);
  192. poscurs(cp,20,18);
  193. write(cp->fd, "     Photon shots : ",20); 
  194. switch (o->id)
  195.     {
  196.     case ROMID :
  197.              sprintf(string,"unknown.                             ");
  198.          break;
  199.     case KLINGID :
  200.              sprintf(string,"unknown.                             ");
  201.          break;
  202.     default: 
  203.     sprintf(string,"   %4d                             ",o->photontorpedos);
  204.          break;
  205.     }
  206. write(cp->fd,string,37);
  207. poscurs(cp,20,19);
  208. write(cp->fd, "     Photon range : ",20); 
  209. switch (o->id)
  210.     {
  211.     case ROMID :
  212.              sprintf(string,"Too far for comfort.                 ");
  213.          break;
  214.     case KLINGID :
  215.              sprintf(string,"Too far for comfort.                 ");
  216.          break;
  217.     default: 
  218.     sprintf(string,"   %4d                             ",o->photonreach);
  219.          break;
  220.     }
  221. write(cp->fd,string,37);
  222. }
  223.  
  224.